//
//  ViewController.swift
//  GestureUnlocking
//
//  Created by 移云 on 2020/5/13.
//  Copyright © 2020 MaoYeYeDeJiangCuCha. All rights reserved.
//

import UIKit
//手势解锁
class ViewController: UIViewController {

    
    let sudokuView = SudokuView.init(frame: UIScreen.main.bounds)
    let userImageView = UIImageView.init(frame:UIScreen.main.bounds)
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        
        //UIColor的平铺方法
        self.view.backgroundColor = UIColor.init(patternImage: UIImage(named: "Home_refresh_bg")!)
        
        self.view.addSubview(sudokuView)
        sudokuView.passwordBlock = { [weak self](pwd) in
            if let weakSelf = self{
                if pwd == "14569"{
                    weakSelf.sudokuView.isHidden = true
                    weakSelf.userImageView.image = UIImage(named: "Home_refresh_bg2")
                    weakSelf.view.addSubview(weakSelf.userImageView)
                    return true
                }else{
                    return false
                }
            }else{
                return false
            }
        }
       
    }

    
}

